\hypertarget{class_c_timer}{\section{C\+Timer类 参考}
\label{class_c_timer}\index{C\+Timer@{C\+Timer}}
}


独占定时器类(基于\+C回调函数的定时器,每个定时器独占一个线程)  




{\ttfamily \#include $<$Timer.\+h$>$}

类 C\+Timer 继承关系图\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{class_c_timer}
\end{center}
\end{figure}
\subsection*{Public 成员函数}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_c_timer_a149a71ef058be76531d98f2cb45d999b}{{\bfseries C\+Timer} (sint32 id, \hyperlink{class_c_timer_protocol}{C\+Timer\+Protocol} $\ast$owner)}\label{class_c_timer_a149a71ef058be76531d98f2cb45d999b}

\item 
sint32 \hyperlink{class_c_timer_af869bfb6ded2b04e3149c663325fd737}{start} (sint32 interval, sint32 unit, S\+E\+L\+\_\+onctimer ontime=N\+U\+L\+L)
\begin{DoxyCompactList}\small\item\em 启用定时器 \end{DoxyCompactList}\item 
sint32 \hyperlink{class_c_timer_a69c2fc2baf8a1a3c9987b1a7b0679c3d}{stop} ()
\begin{DoxyCompactList}\small\item\em 停止定时器 \end{DoxyCompactList}\item 
\hypertarget{class_c_timer_a8e02be1b5686ab4163f025b7f6b7c80c}{sint32 {\bfseries get\+Id} ()}\label{class_c_timer_a8e02be1b5686ab4163f025b7f6b7c80c}

\end{DoxyCompactItemize}


\subsection{详细描述}
独占定时器类(基于\+C回调函数的定时器,每个定时器独占一个线程) 

\subsection{成员函数说明}
\hypertarget{class_c_timer_af869bfb6ded2b04e3149c663325fd737}{\index{C\+Timer@{C\+Timer}!start@{start}}
\index{start@{start}!C\+Timer@{C\+Timer}}
\subsubsection[{start}]{\setlength{\rightskip}{0pt plus 5cm}sint32 C\+Timer\+::start (
\begin{DoxyParamCaption}
\item[{sint32}]{interval, }
\item[{sint32}]{unit, }
\item[{S\+E\+L\+\_\+onctimer}]{onctimer = {\ttfamily NULL}}
\end{DoxyParamCaption}
)}}\label{class_c_timer_af869bfb6ded2b04e3149c663325fd737}


启用定时器 


\begin{DoxyParams}{参数}
{\em interval} & 时间间隔 \\
\hline
{\em unit} & 时间单位 \\
\hline
{\em ontimer} & 定时回调函数,如果不设置则使用统一默认的on\+C\+Timer函数. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
定时时间最小为100ms 
\end{DoxyNote}
\hypertarget{class_c_timer_a69c2fc2baf8a1a3c9987b1a7b0679c3d}{\index{C\+Timer@{C\+Timer}!stop@{stop}}
\index{stop@{stop}!C\+Timer@{C\+Timer}}
\subsubsection[{stop}]{\setlength{\rightskip}{0pt plus 5cm}sint32 C\+Timer\+::stop (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_c_timer_a69c2fc2baf8a1a3c9987b1a7b0679c3d}


停止定时器 


\begin{DoxyParams}{参数}
{\em none} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}


该类的文档由以下文件生成\+:\begin{DoxyCompactItemize}
\item 
libemb/inc/\hyperlink{_timer_8h}{Timer.\+h}\item 
libemb/src/Timer.\+cpp\end{DoxyCompactItemize}
